<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link href="/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body, html {
	width: 100%;
	height: 100%;
	margin: 0;
	font-family: "微软雅黑";
}

#allmap {
	width: 100%;
	height: 100%;
}

p {
	margin-left: 5px;
	font-size: 14px;
}
</style>
<script src="/vendors/jquery/dist/jquery.min.js"></script>
<script src="/vendors/layer/layer.js"></script>
<script src="/js/base/upAdminLayer.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=47vEMrUPXkGWul3APowwKZ1w"></script>
<title>定位</title>
</head>
<body>
	<div class="navbar-form navbar-left">
		<div class="form-group">
			<input type="text" id="area" name="area" th:value="${param.area}" class="form-control" placeholder="地点名称" style="width: 177px; margin-left: 17px; float: left;">
			<button type="button" class="btn btn-default" style="margin-left: 14px;" onclick="search()">搜索</button>
		</div>
	</div>
	<div id="allmap"></div>
	<script type="text/javascript" th:inline="javascript">
		// 百度地图API功能
		var map = new BMap.Map("allmap");
		var top_left_navigation = new BMap.NavigationControl();
		
		map.addControl(top_left_navigation);
		var local = new BMap.LocalSearch(map, {
			renderOptions : {
				map : map
			}
		});
		local.search([[${param.area[0]}]]);
		map.addEventListener("click", function(e) {
			window.parent.locateCallback(e.point.lng, e.point.lat)
			adminLayer.msg('标记成功')
		});
		
		function search() {
			local.search(document.getElementById('area').value);
		}
	</script>
</body>
</html>
